<template>
  <section>
    分享
  </section>
</template>
<script>
import { getUrlData } from '../../libs/publicMethod'
  export default {
    components: { getUrlData },
    data (){
      return {
        xx: '分享'
      }
    },
    mounted () {
      sessionStorage.setItem('inviterID',this.getCode('inviterID'));
      this.$router.replace(this.getCode('gotoPage'))
    },
    methods:{
      getCode(name){  
        var url = sessionStorage.getItem('webUrl');
        var pattern = new RegExp("[?&]" + name + "\=([^&]+)", "g");
        var matcher = pattern.exec(url);
        var items = null;
        if (null != matcher) {                    
            try {
                items = decodeURIComponent(decodeURIComponent(matcher[1]));
            } catch (e) {
                try {
                    items = decodeURIComponent(matcher[1]);
                } catch (e) {
                    items = matcher[1];
                }
            }
        }
        return items;
      }
    }
  }
</script>